<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>消息推送登录</title>
    <meta name="author" content="DeathGhost">
    <link rel="stylesheet" type="text/css" href="/bdtlaw/messagesp/index/static/assets/css/style.css" tppabs="css/style.css">
    <link rel="icon"  type="image/x-icon"  href="/bdtlaw/messagesp/index/static/assets/img/favicon.ico">
    <style>
        body{height:100%;background:#16a085;overflow:hidden;}
        canvas{z-index:-1;position:absolute;}

        .shake_effect{
            -webkit-animation-name: shake;
            animation-name: shake;
            -webkit-animation-duration: 1s;
            animation-duration: 1s;
        }
        @-webkit-keyframes shake {
            from, to {
                -webkit-transform: translate3d(0, 0, 0);
                transform: translate3d(0, 0, 0);
            }

            10%, 30%, 50%, 70%, 90% {
                -webkit-transform: translate3d(-10px, 0, 0);
                transform: translate3d(-10px, 0, 0);
            }

            20%, 40%, 60%, 80% {
                -webkit-transform: translate3d(10px, 0, 0);
                transform: translate3d(10px, 0, 0);
            }
        }

        @keyframes shake {
            from, to {
                -webkit-transform: translate3d(0, 0, 0);
                transform: translate3d(0, 0, 0);
            }

            10%, 30%, 50%, 70%, 90% {
                -webkit-transform: translate3d(-10px, 0, 0);
                transform: translate3d(-10px, 0, 0);
            }

            20%, 40%, 60%, 80% {
                -webkit-transform: translate3d(10px, 0, 0);
                transform: translate3d(10px, 0, 0);
            }
        }
    </style>
    <script src="/bdtlaw/messagesp/index/static/assets/js/jquery.min.js"></script>
    <script src="/bdtlaw/messagesp/index/static/assets/js/verificationNumbers.js" tppabs="js/verificationNumbers.js"></script>
    <script src="/bdtlaw/messagesp/index/static/assets/js/Particleground.js" tppabs="js/Particleground.js"></script>
    <script  src="/bdtlaw/messagesp/index/static/assets/js/json2.js"></script>
    <script type="application/javascript" src="/bdtlaw/messagesp/index/static/assets/js/layer/layer.js"></script>
    <script>
        $(document).ready(function() {
            //粒子背景特效
            $('body').particleground({
                dotColor: '#5cbdaa',
                lineColor: '#5cbdaa'
            });

          /*  $(".submit_btn").click(function(){
                var name=$("#username").val();
                var pass=$("#password").val();

                var user = new Object();
                user.username=name;
                user.password=pass;
                alert(name);

                $.ajax({
                    url: "/bdtlaw/messagesp/index/login",
                    type: "POST",
                    contentType: 'application/json',
                    data: JSON.stringify(user),
                    success: function (data)
                    {

                        if (data.status==200) {
                            alert("消息发送成功!");
                            location.reload();
                        } else {
                            alert("消息发送失败!");
                        }
                    }
                })


                if(name=="管理员" && pass=="123")
                {
                    alert("登录成功！");
                    $("#username").val("");
                    $("#password").val("");

                }
                else
                {
                    $("#login_form").removeClass('shake_effect');
                    setTimeout(function()
                    {
                        $("#login_form").addClass('shake_effect')
                    },1);
                }
              location.href="/bdtlaw/messagesp/index";
            });*/
        });



        function login(){

            var name=$("#username").val();
            var pass=$("#password").val();

            var user = new Object();
            user.username=name;
            user.password=pass;


            $.ajax({
                url: "/bdtlaw/messagesp/index/login",
                type: "POST",
                contentType: 'application/json',
                data: JSON.stringify(user),
                success: function (data)
                {
                    if (data.status==200) {
                        location.href="/bdtlaw/messagesp/index";
                    }
                    if (data.status==400)  {
                        layer.msg("用户名密码错误");
                        $("#login_form").removeClass('shake_effect');
                        setTimeout(function()
                        {
                            $("#login_form").addClass('shake_effect')
                        },1);
//                        location.href="/bdtlaw/messagesp/index/home2";
                    }
                }
            })
        }
    </script>
</head>
<body style="background: black;">
<div id="login_form" class="form">
<dl class="admin_login" >
    <dt>
        <strong>消息推送</strong>
        <em>Messages  Push</em>
    </dt>
    <dd class="user_icon">
        <input type="text" placeholder="账号"  id="username" class="login_txtbx">
    </dd>
    <dd class="pwd_icon">
        <input type="password" placeholder="密码" id="password" class="login_txtbx">
        <csrf disabled="true"/>
    </dd>

    <dd>
        <input type="button" value="立即登陆" onclick="login();" class="submit_btn">
    </dd>

</dl>
    </div>
</body>
</html>
